home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 80 / CD Actual 80 Julio-Agosto 2003.iso / Linux / LinuxGazette / lg / issue72 / misc / nielsen / modules / Email.pm < prev    next >
Encoding:
Perl POD Document  |  2002-08-14  |  648 b   |  50 lines

  1. #!/usr/bin/perl
  2.  
  3. package SAMPLE::Email;
  4.  
  5. use strict;
  6. use Apache;
  7. use DBI;
  8. use CGI;
  9. use SAMPLE::Misc;
  10. use SAMPLE::Constants;
  11. use Mail::Mailer;
  12.  
  13. sub new
  14. {
  15. my $Class = shift;
  16. my %Args = @_;
  17. my $self = {};
  18.  
  19. $self->{'mail'} = new Mail::Mailer 'sendmail';
  20.  
  21. bless $self,$Class;
  22.  
  23. return ($self);
  24. }
  25.  
  26. #--------------------------------------------------------------------------
  27.  
  28. sub Send_Mail {
  29. my $self = shift;
  30. my %Args = @_;
  31.  
  32. my $Header = {};
  33. if (exists $Args{'header'}) { $Header = $Args{'header'};}
  34. else {return (-1)};
  35. my $Body = $Args{'body'};
  36.  
  37. my $Mail = $self->{'mail'};
  38. $Mail->open($Header);
  39. print $Mail $Body;
  40.  
  41. $Mail->close;
  42.  
  43. return (1);
  44. }
  45.  
  46. 1;
  47.  
  48.  
  49. 1;
  50.